package com.AFH.test;

import android.graphics.Canvas;
import android.view.SurfaceHolder;

public class AboutViewThread extends Thread {
	AboutView av;
	SurfaceHolder surfaceHolder;
	boolean flag = false;

	AboutViewThread(AboutView av, SurfaceHolder surfaceHolder) {
		super.setName("AboutThread");
		this.av = av;
		this.surfaceHolder = surfaceHolder;
		flag = true;

	}

	@Override
	public void run() {
		while (flag) {
			Canvas canvas = null;
			try {
				canvas = surfaceHolder.lockCanvas(null);
				synchronized (surfaceHolder) {
					av.doDraw(canvas);
				}
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				if(canvas != null){
					surfaceHolder.unlockCanvasAndPost(canvas);
				}
			}
			try {
				Thread.sleep(1500);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

}
